<?php


namespace app\user\controller;

use think\Db;

/**
 * Class Receipt 回款
 * @package app\user\controller
 */
class Receipt extends LoggingBase
{

    #region 回款管理
    public function Listing(){
        $UserID = $this->m_User->ID;
        $CompanyID = $this->m_User->CompanyID;
        //搜索我的客戶
        $Data = Db::table('client')->field('ID,Name,Contacts,Phone')->where("IsDeleted='0' AND OwnerType='1' AND OwnerID='$UserID'")->select();
        $this->assign('Clients',$Data);
        //公司員工
        $Data = Db::table('user')->field('u.ID,u.Name,u.Nick,u.Phone,cd.Name AS DepartmentName')->alias('u')->leftJoin('company_department cd','cd.ID=u.DepartmentID')->where("u.IsDeleted='0' AND u.CompanyID='$CompanyID'")->select();
        $this->assign('Users',$Data);

        $this->assign('Today', date('Y-m-d'));

        $this->assign('UserID',$UserID);
        $Css = array(
            '<link href="/layui/css/layui.css" rel="stylesheet"/>'
        );
        return $this->mb_Display('回款管理', 'ContractList', 'contract_list', $Css);
    }

    public function mb_Listing(){

    }
    #endregion

}